{include "Public/header"}
<script type="text/javascript">
$(function(){
	$("form").validate({
		rules : {
			{if !isset($_GET['id'])}
			"username" : {
				required : true,
				rangelength : [ 2, 20 ],
				remote:{
					type:"POST",
					url:"{:U('Validate/isAdminNameExist')}"
				}
			},
			"password" : {
				required : true,
				rangelength : [ 6, 32 ]
			},
			{/if}
			realname:{
				required:true,
				rangelength : [ 2, 10 ]
			}
		},
		messages:{
			username:{
				required:"用户名必须填写",
				rangelength:"用户名必须在2-20个字符之间",
				remote:"用户名已经存在"
			},
			password:{
				required:"密码必须填写",
				rangelength:"密码必须在6-32位之间"
			}
		}
	});
});
</script>
	<div class="page_tit">{$title}</div>
	<!-- START CONFIG_FORM -->
	<form method="POST" action="">
	{if isset($_GET['id'])}
	<input type="hidden" name="id" value="{:intval($_GET['id'])}" />
	{/if}
		<div class="form2">
			<dl class="lineD">
				<dt>
					<font color="red">*</font>用户名：
				</dt>
				<dd>
					<input name="username" maxlength="20" type="text" value="{$info['username']|''}" {if isset($_GET['id'])}disabled{/if} class="s-txt">
				</dd>
			</dl>
			<dl class="lineD">
				<dt>
					{if !isset($_GET['id'])}<font color="red">*</font>{/if}密码：
				</dt>
				<dd>

					<input name="password" type="password" class="s-txt">
						{if isset($_GET['id'])}
						<font color="red">* 不修改密码请保持为空</font>
						{/if}
				</dd>
			</dl>
			<dl class="lineD">
				<dt>
					<font color="red">*</font>角色：
				</dt>
				<dd>
					<select name="role_id">
					{foreach $role_list as $v}
					<option value="{$v['id']}" {if isset($info)&&$info['role_id']==$v['id']}selected="selected"{/if}>{$v['name']}</option>
					{/foreach}
					</select>
				</dd>
			</dl>
			<dl class="lineD">
				<dt>
					操作：
				</dt>
				<dd>
					<span class="left"><input type="checkbox" name="is_forbid" {if isset($info)&&$info['is_forbid']==1}checked{/if} value="1" class="checkbox"></span>
					<span class="left">禁止</span>
				</dd>
			</dl>
			<div class="page_btm">
				<input type="submit" class="btn_b" value="保存"  />
			</div>
		</div>
	</form>
	<!-- END CONFIG_FORM -->
</div>

</html>